package com.wenhai.java.netty;

import org.msgpack.MessagePack;
import org.msgpack.template.Templates;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

public class MessagePackDemo {

    public static void main(String[] args) throws IOException {
        List<String> src = new ArrayList<>();
        src.add("msgpack");
        src.add("kumofs");
        src.add("vier");
        MessagePack messagePack = new MessagePack();
        byte[] raw = messagePack.write(src);
        System.out.println(raw.length);
        List<String> dst = messagePack.read(raw, Templates.tList(Templates.TString));
        System.out.println(dst);
    }
}
